<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>UI 层如何TDD？</title>
    <meta content="1200" property="og:image:width"/>
    <meta content="630" property="og:image:height"/>
    <link rel="icon" href="../../img/icon.png">
    <link as="font" crossorigin="" href="../../Agrandir-Heavy.2fd076131b76.woff2" rel="preload"
          type="font/woff2"/>
    <link as="font" crossorigin="" href="../../Agrandir-Bold.5adcade67872.woff2" rel="preload"
          type="font/woff2"/>
    <link as="font" crossorigin="" href="../../source-sans-pro-v14-latin-regular.899c8f78ce65.woff2"
          rel="preload" type="font/woff2"/>
    <link as="font" crossorigin="" href="../../Agrandir-Regular.11a4ceb99823.woff2" rel="preload"
          type="font/woff2"/>
    <link as="font" crossorigin="" href="../../source-sans-pro-v14-latin-600.c85615b29630.woff2" rel="preload"
          type="font/woff2"/>
    <link href="../../common.0016184b0568.css" rel="stylesheet" type="text/css"/>
    <link href="../../home.a12d472bcf09.css" rel="stylesheet" type="text/css"/>
    <link href="../content-page.css" rel="stylesheet" type="text/css"/>
</head>
<header class="site-header">
    <br/>
    <h1 style="margin: 0 auto;text-align: left;margin: 0 50px;color: white;font-size: 3.5rem">
        <img src="../../svg/icon-white.svg" height="80" width="80"/>&nbsp;&nbsp;Neil's wiki
        <button class="subscribe" onclick="location.href='../subscribe/index.html'">Subscribe</button>
    </h1>
    <br/>
</header>
<body class="content-body">
<div class="content-body-class">
    <h1 class="hosting-pricing-plan-block__header">UI 层如何TDD？</h1>
    <div class="content-infos">
        <div class="content-words">
            在我经历过或者听过的项目中，UI层一般连单元测试测试都没有，这个是前端的永恒之谜，说实话没有对这个问题有过多的研究。
        </div>
        <div class="content-words">
            单从技术卓越来看，UI层的测试也是可以写的，但从软件工程角度来说，UI层的测试价值高不高是我们要去权衡的一个点，如果只是UI展示，目前对它写测试的项目团队不多，如果是UI
            层的业务逻辑，一些框架在这块分层做的好的话，也是可以写单元测试的，能够写单元测试的地方就能够采用TDD。
        </div>
        <div class="content-words">
            另外，已有ThoughtWorks同事谢宝龙，写了一遍<a href="https://mp.weixin.qq.com/s/D_HYOZcK-dtSMv59Lj3K7A">关于前端TDD的干货文章</a>
        </div>
        <div class="content-addition">
            文章转载自<a href="https://xpbootcamp.cn/tdd/questions/010">袁慎建</a>
        </div>
    </div>
</div>
</body>
</html>
<div class="back-to-home-page">
    <a class="call-to-action__link button" href="/">返回首页</a>
</div>
